{extend name="base" /}
{block name="body"}
<div class="layui-tab layui-tab-brief">

    <div class="layui-tab-content">
        <form class="layui-form layui-form-pane" action="{:url('index/adminmsg/index')}" method="get">
            <div class="layui-inline">
                <label class="layui-form-label">数据库id</label>
                <div class="layui-input-inline">
                    <input type="text" name="sqlid" value="{$sqlid}" placeholder="请输入数据库" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">关键词</label>
                <div class="layui-input-inline">
                    <input type="text" name="keyword" value="{$keyword}" placeholder="请输入关键词" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">类型</label>
                <div class="layui-input-inline">
                    <input type="text" name="type" value="{$type}" placeholder="请输入关键词" class="layui-input">
                </div>
            </div>

            <div class="layui-inline">
                <button class="layui-btn">搜索</button>
            </div>
        </form>
        <hr>


        <form action="" method="post" class="ajax-form">
            <button type="button" class="layui-btn layui-btn-small ajax-action" data-action="{:url('index/adminmsg/local_save_oss',['sqlid'=>$sqlid])}">上传OSS</button>
            <button type="button" class="layui-btn layui-btn-danger layui-btn-small ajax-action" data-action="{:url('index/adminmsg/delete_locals',['sqlid'=>$sqlid])}">删除本地文件</button>

            <div class="layui-tab-item layui-show">
                <table class="layui-table">
                    <thead>
                    <tr>
                        <th style="width: 15px;"><input type="checkbox" class="check-all"></th>
                        <th style="width: 30px;">域名路径</th>
                        <th style="width: 30px;">是否上传oss</th>
                        <th>oss图片</th>
                        <th>客服id</th>
                        <th>内容</th>
                        <th>发送时间</th>
                        <th>聊天类型</th>
                        <th>appid</th>
                        <th>发送人</th>
                        <th>组长id</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {foreach name="msg_list" item="vo"}
                    <tr>
                        <td><input type="checkbox" name="ids[]" value="{$vo.id}">{$vo.id}</td>
                        <td>{$vo.content}</td>
                        <td>{$vo.oss_name}</td>
                        <td>
                            <img class="oss_img" style="width: 20px;height: auto;" src="{$vo.oss_url}">
                            <img style="display: none;width: 300px;position: absolute;margin: 5px;height: auto;" src="{$vo.oss_url}">
                        </td>
                        <td>{$vo.cs_id}</td>
                        <td>
                            <img class="report_img" style="width: 20px;height: auto;" src="{$vo.content}">
                            <img style="display: none;width: 300px;position: absolute;margin: 5px;height: auto;" src="{$vo.content}">
                        </td>
                        <td>{$vo.send_time}</td>
                        <td>{$vo.type}</td>
                        <td>{$vo.appid}</td>
                        <td>{php}echo $vo['send_type']==1002 ? '客服' : '客户';{/php}</td>
                        <td>{$vo.pid}</td>
                        <td>
                            <a href="{:url('index/adminmsg/local_save_one',['id'=>$vo['id'],'sqlid'=>$sqlid])}" class="layui-btn layui-btn-normal layui-btn-mini">添加OSS</a>
                            <a href="{:url('index/adminmsg/delete_local',['id'=>$vo['id']])}" class="layui-btn layui-btn-danger layui-btn-mini ajax-delete">删除本地文件</a>
                        </td>
                    </tr>
                    {/foreach}
                    </tbody>
                </table>
                <!--分页-->
                {$msg_list->render()}
            </div>
        </form>
        <hr>

    </div>
</div>

{/block}